let app = new Vue({
	el: "#main-content",
	data:{
		pageNum1 : 1,
		pageSize : 5,
		getList1: ""
	},
	created() {
		this.getList()
	},
	methods:{
		getList(pageNum){
			console.log(1);
			if(pageNum>0){
				this.pageNum1=pageNum;
			}
			let data = new URLSearchParams;
			data.append("pageNum",this.pageNum1);
			data.append("pageSize",this.pageSize);
			axios({
				url : "cangku/goodsDetailAll",
				method : "post",
				data : data,
				headers:{"token":localStorage.token,"url":window.location.pathname}
			}).then(response=>{
				this.getList1=response.data.data;
				console.log(this.getList1);
			})
		},
		insertZhuangtai(applyForId,zhuangtai,bumen){
			let data = new URLSearchParams;
			console.log(bumen);
			console.log(applyForId);
			console.log(zhuangtai);
			data.append("zhuangtai",zhuangtai);
			data.append("applyForId",applyForId);
			data.append("bumen",bumen);
			
			axios({
				url : "cangku/insertZhuangtai",
				method : "post",
				data : data,
				headers:{"token":localStorage.token,"url":window.location.pathname}
			}).then(response=>{
				if(response.data.data){
					this.getList(1);
					alert("操作成功");
					
				}else{
					alert("操作失败");
				}
			})
		}
	}
})